#include "apue.h"
#include <stdio.h>
#include <sys/stat.h>
#include <fcntl.h>
#include <sys/types.h>

int main(int argc, char *argv[]) {
    struct stat st;
    struct timespec times[2];
    if (argc != 2)
        err_quit("Usage: a.out <filename>");

    if (lstat(argv[1], &st) < 0)
        err_sys("stat failed");

    times[0].tv_nsec= UTIME_OMIT;  // not update access time
    times[1]= st.st_mtim;
    times[1].tv_sec-= 3600 * 24;

    utimensat(AT_FDCWD, argv[1], times, AT_SYMLINK_NOFOLLOW);

    return 0;
}
